//
//  HomeHeaderView.m
//  Baby
//
//  Created by YC on 2017/8/8.
//  Copyright © 2017年 YC. All rights reserved.
//

#import "HomeHeaderView.h"

@implementation HomeHeaderView

+ (instancetype)headerViewWithTableView:(UITableView*)tableView {
    static NSString *ID = @"HomeHeaderView";
    
    HomeHeaderView *headerView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:ID];
    
    if (headerView == nil) {
        headerView = [[HomeHeaderView alloc] initWithReuseIdentifier:ID];
    }
    return headerView;
}

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        NSArray* objects = [[NSBundle mainBundle] loadNibNamed:@"HomeHeaderView"
                                                         owner:self
                                                       options:nil];
        UIView *nibView = [objects firstObject];
        
        nibView.frame = self.contentView.bounds;
        nibView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
        
        [self.contentView addSubview:nibView];
    }
    
    return self;
}

@end
